package net.hn.hnms.biz.group.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.hn.hnms.biz.group.domain.vo.SewageMineVo;
import net.hn.hnms.biz.group.service.GroupService;
import net.hn.hnms.sys.common.core.domain.R;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * 公司端污水处理控制器
 */
@RestController
@RequestMapping("group/sewage")
@Api(value = "集团端污水处理控制器", tags = "集团端污水处理控制器")
public class GroupController {

    @Resource
    private GroupService groupService;

    /**
     * 获取当前公司下的污水处理量及复用量
     */
    @GetMapping("getSewageAndReuseValueByDate")
    @ApiOperation("获取煤矿污水处理量及复用量")
    public R<List<SewageMineVo>> getSewage(@ApiParam(value = "公司编码，默认不传查询所有煤矿")String companyCode,
                                           @ApiParam(value = "开始日期，默认不传查询所有时间")@DateTimeFormat(pattern = "yyyy-MM-dd") Date startDay,
                                           @ApiParam(value = "结束日期，默认不传查询所有时间")@DateTimeFormat(pattern = "yyyy-MM-dd") Date endDay) {
        List<SewageMineVo> voList = groupService.getSewageAndReuseValueByDate(companyCode, startDay, endDay);
        return R.ok(voList);
    }

}
